using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace whereIsTheDonutGame
{

    public class Door : Microsoft.Xna.Framework.DrawableGameComponent
    {
        private Model scene;
        private ICamera camera;

        public Door(Game game)
            : base(game)
        {

        }

        public override void Initialize()
        {
            camera = (ICamera)Game.Services.GetService(typeof(ICamera));

            base.Initialize();
        }

        public override void Update(GameTime gameTime)
        {


            base.Update(gameTime);
        }

        public override void Draw(Microsoft.Xna.Framework.GameTime gameTime)
        {
            foreach (ModelMesh mesh in scene.Meshes)
            {
                foreach (BasicEffect effect in mesh.Effects)
                {
                    effect.View = camera.ViewMatrix;
                    effect.Projection = camera.ProjectionMatrix;
                }
                mesh.Draw();
            }
            base.Draw(gameTime);
        }

        protected override void LoadContent()
        {
            scene = this.Game.Content.Load<Model>("box");
        }
    }
}
